export const routes = [
  {
    path: '/',
    redirect: '/center',
    component: () => import('@/layout/basic/index.vue'),
    children: [
      {
        path: '/center',
        name: 'center',
        component: () => import('@/views/center/index.vue'),
        meta: {
          title: {
            en: 'Account Home',
            'zh-cn': '账户首页',
          },
          keepAlive: false,
          activeIndex: '1',
        },
      },
      {
        path: '/center/buy',
        name: 'buy',
        component: () => import('@/views/center/buy.vue'),
        meta: {
          title: {
            en: 'Package Purchase',
            'zh-cn': '套餐购买',
          },
          keepAlive: false,
          activeIndex: '2',
        },
      },
      {
        path: '/center/proxy',
        name: 'proxy',
        component: () => import('@/views/center/proxy.vue'),
        meta: {
          title: {
            en: 'Get Proxy',
            'zh-cn': '获取代理',
          },
          keepAlive: false,
          activeIndex: '3',
        },
      },
      {
        path: '/center/rotatingResidential',
        name: 'rotatingResidential',
        component: () => import('@/views/center/rotatingResidential.vue'),
        meta: {
          title: {
            en: 'Rotating Residential',
            'zh-cn': '动态住宅',
          },
          keepAlive: false,
          activeIndex: '6-1',
        },
      },
      {
        path: '/center/staticResidential',
        name: 'staticResidential',
        component: () => import('@/views/center/staticResidential.vue'),
        meta: {
          title: {
            en: 'Static Residential',
            'zh-cn': '静态住宅',
          },
          keepAlive: false,
          activeIndex: '6-2',
        },
      },
      {
        path: '/center/rechargeDetails',
        name: 'rechargeDetails',
        component: () => import('@/views/center/rechargeDetails.vue'),
        meta: {
          title: {
            en: 'Recharge Details',
            'zh-cn': '费用管理',
          },
          keepAlive: false,
          activeIndex: '7',
        },
      },
      {
        path: '/user/personal',
        name: 'personal',
        component: () => import('@/views/user/personal/index.vue'),
        meta: {
          title: {
            en: 'Package Purchase',
            'zh-cn': '个人信息',
          },
          keepAlive: false,
          activeIndex: '0',
        },
      },
      {
        path: '/distribution/user',
        name: 'distributionUser',
        component: () => import('@/views/distribution/user/index.vue'),
        meta: {
          title: '分销用户',
          keepAlive: false,
          activeIndex: '100-1',
        },
      },
      {
        path: '/distribution/manage',
        name: 'distributionManage',
        component: () => import('@/views/distribution/manage/index.vue'),
        meta: {
          title: '分销管理',
          keepAlive: false,
          activeIndex: '100-2',
        },
      },
      {
        path: '/distribution/channel',
        name: 'distributionChannel',
        component: () => import('@/views/distribution/channel/index.vue'),
        meta: {
          title: '渠道统计',
          keepAlive: false,
          activeIndex: '102-1',
        },
      },
      {
        path: '/manage/log',
        name: 'manageLogs',
        component: () => import('@/views/manage/log/index.vue'),
        meta: {
          title: '登陆分析',
          keepAlive: false,
          activeIndex: '102-1',
        },
      },
      {
        path: '/manage/user',
        name: 'manageUser',
        component: () => import('@/views/manage/user/index.vue'),
        meta: {
          title: '用户管理',
          keepAlive: false,
          activeIndex: '101-1',
        },
      },
      {
        path: '/manage/order',
        name: 'manageOrder',
        component: () => import('@/views/manage/order/index.vue'),
        meta: {
          title: '用户充值',
          keepAlive: false,
          activeIndex: '101-2',
        },
      },
      {
        path: '/manage/pay',
        name: 'managePay',
        component: () => import('@/views/manage/pay/index.vue'),
        meta: {
          title: '支付设置',
          keepAlive: false,
          activeIndex: '103-1',
        },
      },
    ],
  },
  {
    path: '/user/login',
    name: 'login',
    component: () => import('@/views/user/login/index.vue'),
    meta: {
      title: {
        en: 'Login',
        'zh-cn': '登录',
      },
      keepAlive: false,
    },
  },
  {
    path: '/user/register',
    name: 'register',
    component: () => import('@/views/user/register/index.vue'),
    meta: {
      title: {
        en: 'Register',
        'zh-cn': '注册',
      },
      keepAlive: false,
    },
  },
  {
    path: '/error',
    name: 'error',
    component: () => import('@/views/error/index.vue'),
    meta: {
      title: {
        en: 'Alert',
        'zh-cn': '提示',
      },
      keepAlive: true,
    },
  },
  // 匹配不到重定向错误页
  // {
  //   path: '/:pathMatch(.*)',
  //   redirect: '/error',
  // },
];

export default routes;
